import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
const originalReplace = VueRouter.prototype.replace
VueRouter.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}
VueRouter.prototype.replace = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject)
  return originalReplace.call(this, location).catch(err => err)
}


const routes = [
  {
    path: '/daolan',
    name: 'daolan',
    component: () => import(/* webpackChunkName: "Daolan" */ '../views/daolan.vue')
  },
  {
    path: '/changjianyewu',
    name: 'changjianyewu',
    component: () => import(/* webpackChunkName: "Changjianyewu" */ '../views/changjianyewu.vue')
  },
  {
    path: '/yuangongfengcai',
    name: 'yuangongfengcai',
    component: () => import(/* webpackChunkName: "Yangongfengcai" */ '../views/yuangongfengcai.vue')
  },
  {
    path: '/qiyewenhua',
    name: 'qiyewenhua',
    component: () => import(/* webpackChunkName: "Qiyewenhua" */ '../views/qiyewenhua.vue')
  },
  {
    path: '/zhoubianwangdian',
    name: 'zhoubianwangdian',
    component: () => import(/* webpackChunkName: "Zhoubianwangdian" */ '../views/zhoubianwangdian.vue')
  },
  {
    path: '/',
    redirect: '/daolan'
  },
  {
    path: '*',
    redirect: '/'
  },
]

export default new VueRouter({
  routes
})
